package cn.iocoder.yudao.module.ai.dal.mysql.label;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ai.dal.dataobject.label.LabelRelationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ai.controller.admin.label.vo.*;

/**
 * 标签组与标签关联 Mapper
 *
 * @author 侯俊青
 */
@Mapper
public interface LabelRelationMapper extends BaseMapperX<LabelRelationDO> {

    default PageResult<LabelRelationDO> selectPage(LabelRelationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LabelRelationDO>()
                .eqIfPresent(LabelRelationDO::getGroupId, reqVO.getGroupId())
                .eqIfPresent(LabelRelationDO::getLabelId, reqVO.getLabelId())
                .betweenIfPresent(LabelRelationDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(LabelRelationDO::getSuplierId, reqVO.getSuplierId())
                .orderByDesc(LabelRelationDO::getId));
    }

}